var EmpProfileSelector = {
	getView : function(g) {
		var f = new Ext.grid.CheckboxSelectionModel({
			singleSelect : true
		});
		var b = new Ext.grid.ColumnModel({
			columns : [ f, new Ext.grid.RowNumberer(), {
				header : "profileId",
				dataIndex : "profileId",
				hidden : true
			}, {
				header : "档案编号",
				dataIndex : "profileNo"
			}, {
				header : "员工姓名",
				dataIndex : "fullname"
			} ]
		});
		var c = new Ext.data.JsonStore({
			url : __ctxPath + "/hrm/listEmpProfile.do",
			root : "result",
			baseParams : {
				"Q_approvalStatus_SN_EQ" : 1
			},
			totalProperty : "totalCounts",
			remoteSort : true,
			fields : [ {
				name : "profileId",
				type : "int"
			}, "profileNo", "fullname", "jobId", "position", "standardMiNo",
					"standardMoney", "standardName", "standardId",
					"approvalStatus", "depName", "depId", "delFlag", "userId",
					"idCard" ]
		});
		var d = new Ext.grid.GridPanel({
			id : "EmpProfileSelectorGrid",
			width : 400,
			height : 300,
			region : "center",
			title : "档案列表",
			store : c,
			shim : true,
			trackMouseOver : true,
			disableSelection : false,
			loadMask : true,
			cm : b,
			sm : f,
			viewConfig : {
				forceFit : true,
				enableRowBody : false,
				showPreview : false
			},
			bbar : new HT.PagingBar({
				store : c
			})
		});
		c.setDefaultSort("profileId", "desc");
		c.load({
			params : {
				start : 0,
				limit : 10
			}
		});
		var a = new Ext.FormPanel(
				{
					width : 400,
					region : "north",
					id : "EmpProfileForm",
					height : 40,
					frame : false,
					border : false,
					layout : "hbox",
					layoutConfig : {
						padding : "5",
						align : "middle"
					},
					defaults : {
						xtype : "label",
						margins : {
							top : 0,
							right : 4,
							bottom : 4,
							left : 4
						}
					},
					items : [
							{
								text : "请输入查询条件:"
							},
							{
								text : "姓名"
							},
							{
								xtype : "textfield",
								name : "Q_fullname_S_LK"
							},
							{
								xtype : "button",
								text : "查询",
								iconCls : "search",
								handler : function() {
									var h = Ext.getCmp("EmpProfileForm");
									var i = Ext
											.getCmp("EmpProfileSelectorGrid");
									if (h.getForm().isValid()) {
										h
												.getForm()
												.submit(
														{
															waitMsg : "正在提交查询",
															url : __ctxPath
																	+ "/hrm/listEmpProfile.do",
															params : {
																start : 0,
																limit : 10,
																"Q_approvalStatus_SN_EQ" : 1
															},
															method : "post",
															success : function(
																	k, m) {
																var j = Ext.util.JSON
																		.decode(m.response.responseText);
																var l = i
																		.getStore();
																l.loadData(j);
																l
																		.setDefaultSort(
																				"profileId",
																				"desc");
															}
														});
									}
								}
							} ]
				});
		var e = new Ext.Window({
			title : "档案选择",
			iconCls : "menu-profile",
			width : 630,
			height : 380,
			layout : "border",
			border : false,
			items : [ a, d ],
			modal : true,
			buttonAlign : "center",
			buttons : [ {
				iconCls : "btn-ok",
				text : "确定",
				handler : function() {
					var h = Ext.getCmp("EmpProfileSelectorGrid");
					var i = h.getSelectionModel().getSelections();
					var j = Array();
					j.push(i[0].data.profileId);
					j.push(i[0].data.profileNo);
					j.push(i[0].data.fullname);
					j.push(i[0].data.jobId);
					j.push(i[0].data.position);
					j.push(i[0].data.depId);
					j.push(i[0].data.depName);
					j.push(i[0].data.standardMiNo);
					j.push(i[0].data.standardName);
					j.push(i[0].data.standardMoney);
					j.push(i[0].data.standardId);
					j.push(i[0].data.idCard);
					j.push(i[0].data.userId);
					if (g != null) {
						g.call(this, j);
					}
					e.close();
				}
			}, {
				text : "取消",
				iconCls : "btn-cancel",
				handler : function() {
					e.close();
				}
			} ]
		});
		return e;
	}
};